1. Field of the Invention
The present invention relates to a method for resetting a memory in a computer system, especially relates to a method for resetting the memory that is able to ensure the memory to be initialized correctly during a resetting process.
2. Description of the Prior Art
Generally, when the computer system is turned on, the computer system will initialize the memory. After the memory is initialized, the computer system can control the memory through the memory controller for performing read operations and write operations of the memory in a mode required by the computer system. When the user resets the computer system, the memory should be restored to the default state so that the computer system can control the memory to perform operations again. In the prior art, the reset process of the memory may be done by hardware. For example, the memory may include a reset pin, and the memory controller can trigger the reset process of memory by controlling the reset pin of the memory. However, in this case, the memory has to include an additional pin, thereby increasing both the chip area of the memory and the complexity of the routing on the circuit board.
To avoid increasing the chip size of the memory, in the prior art, the reset process of the memory may also be done by software. For example, the memory controller may issue a set of predetermined reset instructions to the memory to reset the memory. However, the computer system may be reset under different conditions, and the status of the memory may vary before the computer system is reset. For example, the memory may receive the read/write instructions through two or four channels according to the system requirement. In this case, when the memory controller controls the memory with reset instructions that are fixed, the memory may not be reset correctly, after the computer system has reset, if the number of channels being used by the memory do not match with the number of channels the memory controller, according to the fixed reset instructions, is configured to use. If the memory is not reset correctly, the computer system would not be able to initialize the memory again and would not be able to control the memory to perform read/write operations after the computer system is reset.
Therefore, a method for ensuring that the memory can be reset correctly together with the computer system and then correctly initialized without adding additional pins has become an issue to be solved.